﻿#

param
(
	[uint16]$不可重任务id
)


if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
	& 'c:\ProgramData\kasini3000\0k_source.ps1'
}

if ($IsLinux -eq $True)
{
	& '/etc/kasini3000/0k_source.ps1'
}

if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{

	$private:temp999 = & 'kdir-cmdb.ps1' -被查找的库文件名 'invoke_福报库.ps1'
	if ( ($private:temp999 -eq '输入的库路径有错误') -and ($private:temp999 -eq '无返回') )
	{
		Write-Error "找不到 'invoke_福报库' "
		exit 1
	}
	else
	{
		$invoke_福报库 = $private:temp999
	}

	$sqlite_sql = @"
SELECT "不可重任务id","被控机ip","命令行","标准输出","任务状态","任务预定开始时间","任务实际结束时间","任务预定超时时间","备注" FROM "福报任务表rs" WHERE "不可重任务id"=${不可重任务id} LIMIT 1
;
"@

	try
	{
		$结果 = & $invoke_福报库 -sqlite_sql语句 $sqlite_sql
	}
	catch
	{
		Write-Error "错误：福报rs表,读取最后【1】个结果输出,失败"
		exit 2
	}
	finally
	{

	}
	Write-Host "福报rs表,读取最后【1】个结果输出,成功" -ForegroundColor Green
	return $结果
}
exit 0
